//反选
function fn() {
    //找到checkbox
    let checkbox = document.getElementsByClassName('hobby');
    //遍历
    for (let i = 0; i < checkbox.length; i++) {
        checkbox[i].checked = !checkbox[i].checked;
    }
}
//全选
function alls() {
    let checkbox = document.getElementsByClassName('hobby');
    for (let i = 0; i < checkbox.length; i++) {
        if (!checkbox[i].checked) {
            checkbox[i].checked = true;
        }
    }
}

//全不选
function no() {
    let checkbox = document.getElementsByClassName('hobby');
    for (let i = 0; i < checkbox.length; i++) {
        if (checkbox[i].checked) {
            checkbox[i].checked = false;
        }
    }
}